<include file="./Application/Home/View/default/public/header.html" title="我的课程"/>
<link rel="stylesheet" href="/Public/order/studentorder/studentorder.css">
<div id="teacher-form" class="teacher-form body-margin">
    <div class="container">
        <if condition="$isMobile eq 1 ">
            <div class="m-head">
                <p class="left">您的课程</p>
                <div class="right dropdown">
                  <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                    <span class="dropdown-menu-btn"></span>
                    <span class="icon-dropdown"></span>
                  </button>
                  <ul class="dropdown-menu dropdown-menu-list" aria-labelledby="dropdownMenu1">
                    <li><a href="?type=all" class="">全部课程</a></li>
                    <li><a href="?type=inpay" class="">待付款课程</a></li>
                    <li><a href="?type=handing" class="">进行中课程</a></li>
                    <li><a href="?type=dealing" class="">待处理课程</a></li>
                    <li><a href="?type=end" class="">已结束课程</a></li>
                  </ul>
                </div>
            </div>
            <div class="table m-main">
                <foreach name="lists" item="course">
                    <ul class="list-group group">
                      <li class="list-group-item order-id"  is_certified="{$course.is_certified}" order-id={$course.order_sn}<?php echo sprintf("%03d",$course['renew']);?>>
                            <span>课程编号:<em>{$course.order_sn}<?php echo sprintf("%03d",$course['renew']);?></em></span>
                            <span class="right">
                                <?php $statusarr = array('1' =>'待审核', '2' =>'待付款','3' =>'进行中','4' =>'待结束','5' =>'已结束');?>
                                <?php echo $statusarr[$course['status']];?>
                            </span>
                      </li>
                      <li class="list-group-item">
                          <span>老师</span>
                          <a class="right" href="/Home/Index/teacherDetail/id/{$course.teacher_id}" target="_blank">{$course.relname}</a>
                      </li>
                      <li class="list-group-item">
                            <span>学科</span>
                            <span class="right" >{$course.lesson}</span>
                      </li>
                      <li class="list-group-item">
                            <span>上课时间</span>
                            <span class="right" >{$course.date}</span>
                      </li>
                      <li class="list-group-item">
                            <span>课时单价</span>
                            <span class="right courseprice" >{$course.courseprice}元</span>
                      </li>
                      <li class="list-group-item">
                            <span>剩余上课课时数</span>
                            <span class="right" >{$course.coursenum}小时</span>
                      </li>
                      <li class="list-group-item">
                            <span>上课/支付记录</span>
                            <a  class="right" href="/Home/Order/payrecord/id/{$course.order_sn}" class="pay-detail-btn">查看</a>
                      </li>
                      <li class="list-group-item">
                            <span>操作</span>
                            <if condition="($course['status'] eq 2)">
                                <a class="right pay-btn" href="javascript:;">购买课时</a>
                            <elseif condition="($course['status'] eq 3)"/>
                                <a href="javascript:;" class="right complain">申请售后</a>
                            <elseif condition="($course['status'] eq 4)"/>
                                售后中
                            <elseif condition="($course['status'] eq 5)"/>
                                <a href="javascript:;" class="right complain">申请售后</a>
                            </if>
                            <if condition="($course['coursenum'] elt 2) && ($course['status'] eq 3)">
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <a href="javascript:;" class="renewal-btn right">续费</a>
                            </if>
                      </li>
                    </ul>
                </foreach>
            </div>
        <else/>
            <div class="row">
            <div class="col-md-12 form-body">
                <div class="panel panel-default">
                    <div class="panel-heading text-center">
                        <h3 class="panel-title">您的课程</h3>
                    </div>
                    <div class="tab-course">
                        <nav>
                            <a href="?type=all" class="btn">全部课程</a>
                            <a href="?type=inpay" class="btn">待付款课程</a>
                            <a href="?type=handing" class="btn">进行中课程</a>
                            <a href="?type=dealing" class="btn">待处理课程</a>
                            <a href="?type=end" class="btn">已结束课程</a>
                        </nav>
                         <table class="table table-condensed">
                                <tr>
                                    <td>课程编号</td>
                                    <td>状态</td>
                                    <td>上课时间</td>
                                    <td>学科</td>
                                    <td>老师</td>
                                    <td class="center">课时单价</td>
                                    <td class="center">剩余上课课时数</td>
                                    <td class="center">上课/支付记录</td>
                                    <td class="center">操作</td>
                                </tr>
                                <foreach name="lists" item="course">
                                    <tr class="group">
                                        <td class="order-id" is_certified="{$course.is_certified}" order-id={$course.order_sn}<?php echo sprintf("%03d",$course['renew']);?>>{$course.order_sn}<?php echo sprintf("%03d",$course['renew']);?></td>
                                        <td>
                                            <?php $statusarr = array('1' =>'待审核', '2' =>'待付款','3' =>'进行中','4' =>'待结束','5' =>'已结束');?>
                                            <?php echo $statusarr[$course['status']];?>
                                        </td>
                                        <td>{$course.date}</td>
                                        <td>{$course.lesson}</td>
                                        <td class="teacher">
                                            <a href="/Home/Index/teacherDetail/id/{$course.teacher_id}" target="_blank">{$course.relname}</a>
                                        </td>
                                        <td class="courseprice center">{$course.courseprice}元</td>
                                        <td class="center">{$course.coursenum}小时</td>
                                        <td class="pay-detail center">
                                           <if condition="($course['status'] gt 2) ">
                                                <a href="/Home/Order/payrecord/id/{$course.order_sn}" class="pay-detail-btn">查看</a>
                                           <else/>
                                                -
                                           </if>
                                        </td>
                                        <td class="renewal center">
                                            <if condition="($course['status'] eq 2)">
                                                <a href="javascript:;" class="pay-btn">购买课时</a>
                                            <elseif condition="($course['status'] eq 3)"/>
                                                <a href="javascript:;" class="complain">申请售后</a>
                                            <elseif condition="($course['status'] eq 4)"/>
                                                售后中
                                            <elseif condition="($course['status'] eq 5)"/>
                                                <a href="javascript:;" class="complain">申请售后</a>
                                            </if>
                                            <if condition="($course['coursenum'] elt 2) && ($course['status'] eq 3)">
                                            &nbsp;&nbsp;&nbsp;&nbsp;
                                            <a href="javascript:;" class="renewal-btn">续费</a>
                                            </if>
                                        </td>
                                    </tr>
                                </foreach>
                        </table>
                    </div>
                </div>
            </div>
            </div>
        </if>
    </div>
    <div class="modal fade" id="FastFindModal" tabindex="-1" role="dialog" aria-labelledby="FastFindModalLabel" aria-hidden="true">
        <div class="modal-dialog text-center">
            <div class="modal-content pay-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="FastFindModal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title" id="FastFindModalLabel">请填写购买课时数</h4>
                </div>
                <form action="/Home/Pay/doalipay" id="payForm" method="post">
                    <div class="modal-body">
                        <div class="login-form" ng-controller="FastOrderCtrl">
                            <div class="form-group clearfix">
                                <label class="control-label left" for="coursenum_pay">课时(小时)</label>
                                <input class="form-control login-field long_coursenum" type="text" placeholder="请输入您预约课时" id="coursenum_pay" name="coursenum" required="">
                                <input type="hidden" name="trade_name" rel="订单名称">
                                <input type="hidden" name="courseprice" rel="单价">
                                <input type="hidden" name="WIDbody" rel="订单描述">
                                <input type="hidden" name="WIDout_trade_no" rel="订单id">
                                <input type="hidden" name="is_certified" rel="验证">
                            </div>
                            <a href="javascript:;" class="btn bg-green white btn-lg btn-block" id="payBtn">点击支付</a>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-content renewal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="FastFindModal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title" id="FastFindModalLabel">请填写续费课时数</h4>
                </div>
                <form action="/Home/Pay/doalipay" id="renewalForm" method="post">
                    <div class="modal-body">
                        <div class="login-form" ng-controller="FastOrderCtrl">
                            <div class="form-group clearfix">
                                <label class="control-label left" for="coursenum_renewal">课时(小时)</label>
                                <input class="form-control login-field long_coursenum" type="text" placeholder="请输入您续费课时" id="coursenum_renewal" name="coursenum" required="">
                                <input type="hidden" name="trade_name" rel="订单名称">
                                <input type="hidden" name="courseprice" rel="单价">
                                <input type="hidden" name="WIDbody" rel="订单描述">
                                <input type="hidden" name="WIDout_trade_no" rel="订单id">
                                <input type="hidden" name="is_certified" rel="验证">
                            </div>
                            <a href="javascript:;" class="btn bg-green white btn-lg btn-block" id="renewalBtn">点击支付</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <div class="modal fade" id="complainPanel" tabindex="-1" role="dialog" aria-labelledby="FastFindModalLabel" aria-hidden="true">
        <div class="modal-dialog text-center">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="complainPanel" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title" id="FastFindModalLabel">申请售后</h4>
                </div>
                <form action="#" id="complainForm" method="post">
                    <div class="modal-body">
                        <div class="login-form" ng-controller="FastOrderCtrl">
                            <div class="form-group clearfix">
                                <label class="control-label left" for="coursenum">售后原因</label>
                                <textarea class="form-control login-field  long_remarks" type="text" placeholder="您可以留言售后信息哦,我们会电话联系您" id="desc" name="reback" rows="3"></textarea>
                                <input style="display: none" type="text" name="id" rel="订单id">
                            </div>
                            <a href="javascript:;" class="btn bg-green white btn-lg btn-block" id="complainBtn">提交</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>



</div>
<include file="./Application/Home/View/default/public/footer.html"/>
<script type="text/javascript" src="/Public/order/studentorder/studentorder.js"></script>
</body>
</html>
